home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: August 14, 1996
- // Author: ms
- //
- // Description:
- // Create text using the option box defaults.
- //
- // Input Arguments:
- // The string.
- //
- // Return Value:
- // None.
- //
-
- global proc textCurvesSet(
- int $dohistory,
- int $dohow,
- string $dofont,
- string $text )
- {
- string $textDag[], $letters[], $curves[];
- string $results, $tmp[], $name, $tmpCmd;
- int $i, $n;
- int $historyOnTextCurvesNeeded = 0;
-
- // replace any \ by \\ and " by \" in the string so that the command will
- // create the \ and " as well
- //
- string $totalText = substituteAllString( $text, "\\", "\\\\" );
- $totalText = substituteAllString( $totalText, "\"", "\\\"" );
-
- string $cmd = "textCurves -ch " + $historyOnTextCurvesNeeded +
- " -f \"" + $dofont + "\" -t \"" + $totalText + "\"";
- if ( catch( $textDag = evalEcho($cmd) ) )
- {
- // if textCurves failed then no need to continue since nothing was
- // created
- return;
- }
-
- if( ! $dohow ) {
- select -r $textDag[0];
- return;
- }
-
- $letters = `listRelatives -c $textDag[0]`;
-
- float $tol = `optionVar -q positionalTolerance`;
- $n = size( $letters );
- for( $i=0; $i<$n; $i++ ) {
- $name = ("Trim " + $letters[$i] + " #");
- $tmpCmd = "planarSrf -name \"" + $name + "\" -ch " +
- $dohistory + " -tol " + $tol + " -o on -po " + ($dohow == 2) + " " + $letters[$i];
- $tmp = evalEcho( $tmpCmd );
- if( "" == $results ) {
- $results = `group -n ("Trim " + $textDag[0] + " #") $tmp[0]`;
- }
- else {
- parent $tmp[0] $results;
- }
- }
-
- if( ! $dohistory ) {
- delete $textDag[0];
- }
- select -r $results;
- }
-
-